import {PageContainer, ProTable} from '@ant-design/pro-components';
import {useRef,} from 'react';
import {list} from "./service";

export default () => {
  const actionRef = useRef<any>(null);
  return (
    <PageContainer title={false} childrenContentStyle={{ padding: 16 }} breadcrumb={{}}>
      <ProTable
        loading={false}
        cardProps={false}
        bordered
        actionRef={actionRef}
        options={false}
        search={false}
        request={list}
        pagination={false}
        rowClassName={(record, index) => {
          if (record.win === 1) {
            return 'row-success';
          } else if (record.win === 0) {
            return 'row-error';
          }
          return '';
        }}
        columns={[
          {
            title: 'ID',
            dataIndex: 'id',
            width:40,
          },
          {
            title: '编码',
            dataIndex: 'code',
          },
          {
            title: '名称',
            dataIndex: 'name',
          },
          {
            title: '最小投注金额',
            dataIndex: 'baseBetMoney',
          },
          {
            title: '投注倍数',
            dataIndex: 'baseTimes',
          },
          {
            title: '连续失败次数归零',
            dataIndex: 'continuousLostTimes',
          },
          {
            title: '最大投注金额',
            dataIndex: 'maxBetMoney',
          },
          {
            title: '预测数据量',
            dataIndex: 'predictionCount',
          },
          {
            title: '第几个数字',
            dataIndex: 'walletIndex',
          },
          {
            title: '操作',
            dataIndex: 'opt',
            valueType:'option',
            renderText:(_,record)=>[
              <a>编辑</a>
            ]
          },
        ]}
      />
    </PageContainer>
  );
};
